<?php /* @var $this Controller */ ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

    <link rel="stylesheet" type="text/css" href="<?php //echo Yii::app()->theme->baseUrl; ?>/css/styles.css" />

	<title><?php echo CHtml::encode($this->pageTitle); ?></title>

	<?php Yii::app()->bootstrap->register(); ?>
	 <link rel="stylesheet" type="text/css" href="<?php //echo Yii::app()->theme->baseUrl; ?>/css/bootstrapamelia.css" />
</head>

<body>

<?php 

$badge=$this->widget('bootstrap.widgets.TbBadge', array(
    'type'=>'info',
    'label'=>Invitaciones::model()->getSolicitudes(),
), true);

$badge2=$this->widget('bootstrap.widgets.TbBadge', array(
    'type'=>'info',
    'label'=>Usuarios::model()->getCumpleanos(),
), true);





$this->widget('bootstrap.widgets.TbNavbar',array(
		//'type'=>'inverse', // null or 'inverse'
		//'brand'=>CHtml::link(CHtml::image(Yii::app()->baseUrl.'/images/umbook/logo.png','alt',array('width'=>64,'height'=>64))),
		'brand'=>' ',
		'brandUrl'=>'#',
		'items'=>array(
        array(			
            'class'=>'bootstrap.widgets.TbMenu',
			'encodeLabel'=>false,
            'items'=>array	(
			//	array('label'=>' ', 'url'=>array('#'), 'image'=>CHtml::link(CHtml::image(Yii::app()->baseUrl.'/images/umbook/logo.png','alt',array('width'=>64,'height'=>64))),),
              //  array('label'=>'Inicio', 'url'=>array('/site/principal'), 'icon'=>'icon-home',),
                array('label'=>'Inicio', 'icon'=>'icon-globe', 'url'=>array('/comentarios/vercomentariosmuro'),'visible'=>!Yii::app()->user->isGuest),
				array('label'=>'Perfil', 'icon'=>'icon-user', 'url'=>array('/usuarios/modificarperfil'),'visible'=>!Yii::app()->user->isGuest),
				array('label'=>'Amigos', 'icon'=>'icon-star','url'=>array('#'),'visible'=>!Yii::app()->user->isGuest,
					'items'=>array(
						array('label'=>'Lista de Amigos', 'icon'=>'icon-list', 'url'=>array('amigos/veramigos'),),
						array('label'=>'Buscar Amigos', 'icon'=>'icon-search','url'=>array('/usuarios/buscar'),),
						array('label'=>'Cumpleanos '.$badge2, 'icon'=>'icon-bell','url'=>array('/usuarios/cumpleano'),),
					),
				),				
				array('label'=>'Solicitudes '.$badge, 'url'=>array('/invitaciones/ver'),'visible'=>!Yii::app()->user->isGuest),
				
				array('label'=>'Administrar', 'icon'=>'icon-tasks','url'=>array('#'),'visible'=>Yii::app()->user->isAdmin(),
					'items'=>array(
						array('label'=>'Administrar Usuarios', 'icon'=>'icon-cog', 'url'=>array('usuarios/administrar'),),	
						array('label'=>'Administrar Comentarios', 'icon'=>'icon-cog', 'url'=>array('comentarios/administrar'),),				
					),
				),
				
				
				
				
            ),			
        ),		 	
		 array(			
            'class'=>'bootstrap.widgets.TbMenu',
			'htmlOptions'=>array('class'=>'pull-right'),
            'items'=>array	(
				array('label'=>'Hola '.Yii::app()->session['nombre'].' '.Yii::app()->session['apellido'].'! (Logout)','url'=>array('/site/logout'),'visible'=>!Yii::app()->user->isGuest),
            ),
        ),	
		
    ),
)); ?>
<div class="container">
	<div class="row-fluid">
		<div class="span12"></div>
		<div class="span12"></div>	
		<section id="miscellaneous">
			<div class="row">
			<div class="span3">	
				<?php if(!Yii::app()->user->isGuest){ ?>				
					
					<div class="well" style="padding: 8px 0;">
						<ul class="nav nav-list">
							<li><img class="img-rounded" alt="140x140" width="300" height="250" src="<? echo Yii::app()->baseUrl.'/images/perfil.jpg' ?>" /></li>
							<li class="divider"></li>
							<li class="nav-header">Operaciones</li>
							<li class="divider"></li>								
							<li><a href="<?php echo $this->createUrl('album/ver'); ?>"><i class="icon-book"></i>Album de Fotos</a></li>
							<li><a href="<?php echo $this->createUrl('fotos/subirfoto'); ?>"><i class="icon-picture"></i>Subir Foto</a></li>
							<li><a href="<?php echo $this->createUrl('gruposdeamigos/ver'); ?>"><i class="icon-cog"></i>Grupos</a></li>		
							<li><a href="<?php echo $this->createUrl('comentarios/vercomentariosmuro'); ?>"><i class="icon-comment"></i>Muro</a></li>		
							<li class="divider"></li>
							<li class="nav-header">Grupos</li>
							<li class="divider"></li>
							<?php 
							Yii::app()->runController('site/getgrupos');
							//Yii::app()->controller->getGrupos();?>
							<li class="divider"></li>
						</ul>
					</div>
					<?php } else {?>	
							<img src="<? echo Yii::app()->baseUrl.'/images/umbook/logo.png' ?>" alt="" width="300" height="700" class="img-rounded" >
						
					
					<?php }  ?>
				</div>
			
				<div class="span9">
					<?php echo $content; ?>
				</div>
			</div>
		
		</section>	
		<hr></hr>
		<footer id="footer">
			<div class="links">
							
			</div>						
			<p></p>
		</footer>
	</div>
</div>	
</body>
</html>
